/**
 * 环境配置
 */
interface EnvSetting {
  local: GlobalSetting
  development: GlobalSetting
  test: GlobalSetting
  production: GlobalSetting
}

interface GlobalSetting {
  baseUrl: string
  domTitle: string
  urlPrefix?: string
  ossPath: string
  mktapi: string // 营销服务api
  storagePreName: string // 存储key
}

/**
 * 本地环境
 */
const localSetting: GlobalSetting = {
  baseUrl: '',
  domTitle: '',
  ossPath: '',
  mktapi: '',
  storagePreName: '',
}

/**
 * 开发环境
 */
const devSetting: GlobalSetting = {
  baseUrl: '',
  domTitle: '',
  ossPath: '',
  mktapi: '',
  storagePreName: '',
}

/**
 * 生产环境
 */
const prodSetting: GlobalSetting = {
  baseUrl: '',
  domTitle: '',
  ossPath: '',
  mktapi: '',
  storagePreName: '',
}

/**
 * 测试环境
 */
const testSetting: GlobalSetting = {
  baseUrl: '',
  domTitle: '',
  ossPath: '',
  mktapi: '',
  storagePreName: '',
}

let currentNodeEnv: string = import.meta.env.MODE

if (import.meta.env.MODE !== 'production')
// currentNodeEnv = 'dev'
// currentNodeEnv = 'production'
// currentNodeEnv = 'local'
  currentNodeEnv = 'test'

const envSetting: EnvSetting = {
  local: localSetting,
  development: devSetting,
  test: testSetting,
  production: prodSetting,
}

export const globalSetting = envSetting[currentNodeEnv as keyof EnvSetting]
